security: gate workspace MCP config behind WorkspaceTrustStore (#213) - #215
Merged
rohitprasad15 merged 2 commits intoJul 30, 2026
Merged
Conversation
Untrusted repos must not define stdio MCP servers that spawn at session open. Skip <.coworker/mcp.json> until the workspace is trusted, matching allowed_commands consent. Fixes andrewyng#213
Extract _mcp_workspace_trusted for the three load sites, drop the unused spawn payload from the regression test, and remove a stray blank line.
Contributor
Author
Review requestCould a maintainer take a look when you have a moment? Suggested reviewers (I don't have permission to formally assign):
Status check
Happy to address any feedback. |
Collaborator
|
Thanks for the fix! |
rohitprasad15
self-requested a review
July 30, 2026 18:19
pull Bot
pushed a commit
to bit-cook/openworker
that referenced
this pull request
Jul 30, 2026
Follow-up to andrewyng#215: a trusted repo can no longer redefine a global server by reusing its name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<workspace>/.coworker/mcp.jsonunless the workspace is trusted via the existingWorkspaceTrustStore— the same consent boundary used for repositoryallowed_commands.~/.config/coworker/mcp.jsoncontinues to load regardless of trust.Fixes #213
Details
prepare_mcp_tools/connect_mcp/mcp_toolsnow passworkspace_trusted=intoload_mcp_servers. Workspace MCP is process provenance (stdiocommand/argsbecome a subprocess before any approval gate), so cloning a repo must not be enough to execute code.Test plan
pytest tests/test_mcp.py(9 passed)prepare_mcp_toolsnever callsMCPManager.ensurefor untrusted workspace servers; calls it after trust.coworker/mcp.jsonand confirm no spawn; trust the workspace and confirm it connects